<?php
use yii\helpers\Url;
// $data_matrix = "https://proxcrm.xgate.com/barcode/frontend/web/index.php?r=qr/barcode&code=" . $userInfo['card_number'] . "&type=barcode";
$barcode = Url::to('@web/jebsen/codemaker/barcode.php?text=' . $userInfo['card_number']);
// echo $barcode;exit;
$this->title = 'J SELECT 会员中心';
?>

<div class="topContainer">
    <div class="weui-flex">
        <div class="weui-flex-item card" id="card">
            <img src="<?= Url::to('@web/jebsen/img/jebsen_card.png' ,true)?>" alt="">
            <div class="qrcode">
                <!-- <img src="<?= Url::to('@web/jebsen/img/qrCode2.png' ,true)?>" alt=""> -->
            </div>
            <P class="getCardNo">NO. <span ><?= $userInfo['card_number'] ?></span></P>
        </div>
    </div>
    <div class="weui_msg_img hide" id="barCard" onclick="$('#barCard').fadeOut();">
        <div class="weui_msg_com">

            <div class="logo">
                <img src="<?= Url::to('@web/jebsen/img/logo.png' ,true)?>">
            </div>
            <p class="prompt">结账时请主动出示会员卡</p>
            <div class="weui_msg_src">
                <img src="<?= $barcode?>">
                <p ><?= $userInfo['code']?></p>
            </div>
            <!-- <p class="weui_msg_comment">长按上方二维码3秒识别二维码</p> -->

        </div>
    </div>
    <div class="weui-flex">
        <!-- <div class="weui-flex-item">
            <div class="topBox">
                <div class="topBoxHead">
                    M币
                </div>
                <div class="topBoxBody">
                    <a href="<?= Url::to(['member/points-detail'])?>" id="getNum">0</a>
                </div>
            </div>
        </div> -->
        <!-- <div class="weui-flex-item ">
            <div class="topBox leftBorder">
                <div class="topBoxHead">
                    优惠券
                </div>
                <div class="topBoxBody">
                    <a href="coupons.html">查看</a>
                </div>
            </div>
        </div> -->
    </div>
</div>

<div class="weui_cells weui_cells_access">
    <a class="weui_cell " href="<?= Url::to(['member/view'])?>">
        <div class="weui_cell_bd weui_cell_primary">
            <p>个人信息</p>
        </div>
        <div class="weui_cell_ft">
        </div>
    </a>
    <a class="weui_cell" href="<?= Url::to(['member/card-detail'])?>">
        <div class="weui_cell_bd weui_cell_primary">
            <p>会员卡详情</p>
        </div>
        <div class="weui_cell_ft">
        </div>
    </a>
</div>

<div id="resText"></div>
</body>
</html>
<?php 
    $js = '
        $(".qrcode").click(function() {
            $("#barCard").fadeIn();
        })
        $("#card").click(function() {
            $("#barCard").fadeIn();
        })
    ';
    $this->registerJs($js, \yii\web\View::POS_END);
?>
